import pygame
import random
#import os
from pygame.locals import *
from defs import *

class PowerupScoreboard(pygame.sprite.Sprite):

   colour = TRANSPARENT#(123,123,123)
   rightPos = SCREENRECT.width - 100
   rightY = 10

   base_image = pygame.Surface((FONT_SIZE_2, FONT_SIZE_2))
   base_image.fill(TRANSPARENT)
   base_image.set_colorkey(TRANSPARENT)
   pointlist = [(0,0), (0,FONT_SIZE_2), (FONT_SIZE_2,FONT_SIZE_2), (FONT_SIZE_2,0)]
   pygame.draw.polygon(base_image, colour, pointlist)

   def __init__(self):
      pygame.sprite.Sprite.__init__(self)
      self.image = self.base_image.copy()
      self.rect = self.image.get_rect()
      
   def setColour(self,newColour):
      self.colour = newColour
      
   
   def setRightPos(self, newPos, newY):
      self.rightPos = newPos
      self.rightY = newY

   def update(self):
      #print 'updating'
      #print self.rightPos
      pygame.draw.polygon(self.base_image, self.colour, self.pointlist)
      self.image = self.base_image.copy()
      self.rect = self.image.get_rect()
      self.rect.centery = self.rightY
      self.rect.right = self.rightPos